<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title></title>

  <style type="text/css">
    html, body {
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
    }

    #map {
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>

<div id="map"></div>

<script type="text/javascript" src="//apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//maps.googleapis.com/maps/api/js?key=AIzaSyDgF_xU8tLp-GwUUlKWa8iTSqOhN1ff7Mg"></script>
<script type="text/javascript" src="../../js/mapv.js"></script>

<script type="text/javascript">

  // Create a map object and specify the DOM element for display.
  var map = new google.maps.Map(document.getElementById('map'), {
    center: new google.maps.LatLng(39.931093, 116.302544),
    scrollwheel: false,
    zoom: 10
  });

  var styles = [
    {
      stylers: [
        { hue: "#00ffe6" },
        { saturation: -20 }
      ]
    },{
      featureType: "road",
      elementType: "geometry",
      stylers: [
        { lightness: 100 },
        { visibility: "simplified" }
      ]
    },{
      featureType: "road",
      elementType: "labels",
      stylers: [
        { visibility: "off" }
      ]
    }
  ];

  map.setOptions({styles: styles});

  var resolutionScale = window.devicePixelRatio || 1;

  // $.get('data/gps', function(rs) {
    var rs = `1461054191395,116.30080570171273,40.040425921155496
1461054196394,116.30079832753286,40.04042944779455
1461054201396,116.3008103487341,40.04043248415757
1461054206397,116.30080461051323,40.040413191929844
1461054211400,116.30080584707672,40.04041563014046
1461054216401,116.30080695999453,40.04042136359914
1461054221405,116.30079843485889,40.04042375298539
1461054226413,116.30080147775848,40.040421089411915
1461054231407,116.30078941942712,40.04043444336331
1461054241415,116.30077463742629,40.04045710076621
1461054236433,116.3007833372029,40.0404757097031
1461054246409,116.30078911952855,40.04046129010898
1461064040099,116.3167548150915,40.02769393769932
1461064054479,116.31675481191934,40.0276939275735
1461064054488,116.31675480873413,40.027693917425296
1461064066161,116.31682534014891,40.02770003873641
1461064071302,116.31682534014891,40.02770003873641
1461064078192,116.31688501625548,40.027593787198214
1461064084207,116.31688501625548,40.027593787198214
1461064419430,116.31900463524502,40.02075641350725
1461064419440,116.3189846565127,40.02064514971436
1461064428440,116.3189846565127,40.02064514971436
1461064434422,116.31901336772948,40.01987666240591
1461064438884,116.31901336772948,40.01987666240591
1461064454427,116.3162245169686,40.01830294666183
1461064459432,116.3162245169686,40.01830294666183
1461064460370,116.3162245169686,40.01830294666183
1461064428440,116.3189846565127,40.02064514971436
1461064509442,116.30710753330476,40.016913169986424
1461064513702,116.30710753330476,40.016913169986424
1461064519442,116.30251010196497,40.01595446440035
1461064524445,116.30222468106946,40.01586288886744
1461064459432,116.3162245169686,40.01830294666183
1461064529443,116.30222468106946,40.01586288886744
1461064460370,116.3162245169686,40.01830294666183
1461064539501,116.30223712490584,40.01585895456359
1461064559501,116.30222212719553,40.01585490959679
1461064579507,116.30218799103821,40.01585342307502
1461064584471,116.30216769656128,40.01585278295152
1461064544465,116.3022359633963,40.01585579767848
1461064524445,116.30222468106946,40.01586288886744
1461064531528,116.30223828294804,40.015862109402526
1461064519442,116.30251010196497,40.01595446440035
1461064614524,116.30209392473516,40.01584287622379
1461064599519,116.302147676679,40.01584866257096
1461064626918,116.27711606352092,40.01168661572354
1461064639505,116.27711584574332,40.01168955774785
1461064649480,116.27685192955488,40.01165124512141
1461064653723,116.27685192955488,40.01165124512141
1461064619472,116.27711606352092,40.01168661572354
1461064634529,116.27711600573281,40.011687396400696
1461064674541,116.27681187896762,40.01163109268767
1461064639477,116.27711584574332,40.01168955774785
1461064684497,116.27658782486094,40.011545045944935
1461064704544,116.27647843991753,40.011499357548935
1461064529443,116.30222468106946,40.01586288886744
1461064564452,116.30220832170828,40.01585406505788
1461064544447,116.3022359633963,40.01585579767848
1461064664484,116.276837778817,40.01164197913579
1461064664512,116.276837778817,40.01164197913579
1461064739574,116.25882078794689,40.00212017493274
1461064774565,116.25881126708202,40.00211506462337
1461064759573,116.25881465447353,40.00211644377181
1461064779516,116.25879641371004,40.00211196216749
1461064779556,116.25879641371004,40.00211196216749
1461064719501,116.25882755400156,40.002124680254695
1461064624470,116.27711606352092,40.01168661572354
1461064804578,116.2586359105639,40.0020695230441
1461064659534,116.27685192612688,40.01165124033399
1461064729507,116.25882382389705,40.00212256591137
1461064733738,116.25882382389705,40.00212256591137
1461064694545,116.27655706362705,40.011532094772534
1461064684490,116.27658782486094,40.011545045944935
1461064564469,116.30220832170828,40.01585406505788
1461064899547,116.21710114464243,39.992069080421544
1461064789569,116.25873894788275,40.00209677699443
1461064804605,116.25863590746158,40.0020694970446
1461064809541,116.25835066546873,40.00200869643481
1461064929554,116.21678873660487,39.99158273260793
1461064744519,116.25881804309833,40.00211782195917
1461064904550,116.21710114464243,39.992069080421544
1461064604468,116.30212791825795,40.01584455274512
1461064604489,116.30212791825795,40.01584455274512
1461065033823,116.21303045031146,39.96777619391325
1461064929581,116.21678873660487,39.99158273260793
1461064794521,116.25868158728143,40.00208161881022
1461064764534,116.25881126728301,40.002115066168436
1461064794541,116.25868158728143,40.00208161881022
1461064744508,116.25881804309833,40.00211782195917
1461064709519,116.27643106520935,40.01147977622802
1461064764514,116.25881126728301,40.002115066168436
1461065029581,116.21303045031146,39.96777619391325
1461064679491,116.27658782486094,40.011545045944935
1461064906485,116.21710114464243,39.992069080421544
1461064694574,116.27652638676642,40.011519178780645
1461064584480,116.30216769656128,40.01585278295152
1461065234638,116.20591884489745,39.92897008083752
1461065033823,116.21303045031146,39.96777619391325
1461065234665,116.20591884489745,39.92897008083752
1461064794541,116.25868158728143,40.00208161881022
1461065244641,116.20307158657045,39.924867729769396
1461065259657,116.20350921661189,39.92344610366534
1461065249646,116.20306815279768,39.92486278236393
1461065278891,116.20502852636156,39.921569943986405
1461065289689,116.20508456469217,39.92144357549018
1461065254643,116.20417967593201,39.92360960298117
1461065254644,116.20417967593201,39.92360960298117
1461065299714,116.20508566961641,39.92143275115507
1461065314710,116.20509375857836,39.92038198195591
1461065304657,116.20509260343034,39.920391824962536
1461065319683,116.2050949113499,39.920372200113206
1461065289657,116.20508456469217,39.92144357549018
1461065334690,116.20509948144799,39.920333420546925
1461065329716,116.20509720055102,39.92035277509757
1461065308882,116.20509260343034,39.920391824962536
1461065384678,116.20461268107515,39.90277119992323
1461065334667,116.20509948144799,39.920333420546925
1461065414690,116.2050715160687,39.89865140637779
1461065398930,116.20482293410888,39.902221251706
1461065429685,116.204890144569,39.89756751594661
1461064709498,116.27643106520935,40.01147977622802
1461065274652,116.20502852636156,39.921569943986405
1461065368917,116.20475911871112,39.91956669486108
1461065404686,116.20491835953483,39.90016581997399
1461065404685,116.20491835953483,39.90016581997399
1461065459751,116.20491328584293,39.89495154132498
1461065479748,116.20491969971296,39.894921159487616
1461065434686,116.20473291291488,39.895394034630655
1461065268891,116.20440381405207,39.92287748796947
1461065439689,116.20473291291488,39.895394034630655
1461065444692,116.20490906801143,39.89497750809779
1461065549719,116.20076293884345,39.87977255312887
1461065564726,116.2008146475694,39.87975595495316
1461065534715,116.20043438949209,39.88840939307375
1461065479761,116.20492320161654,39.89490457133593
1461065424689,116.20500442816359,39.898408698504014
1461065319661,116.2050949113499,39.920372200113206
1461065449692,116.20490906801143,39.89497750809779
1461065552291,116.20076293884345,39.87977255312887
1461065564760,116.2008146475694,39.87975595495316
1461065464696,116.20491616900186,39.894937884101076
1461065688981,116.21435338268914,39.854465224794
1461065389683,116.20461268107515,39.90277119992323
1461065364674,116.20475911871112,39.91956669486108
1461065419693,116.20507233449523,39.898749576621896
1461065544718,116.20076293884345,39.87977255312887
1461065684754,116.21435338268914,39.854465224794
1461065284695,116.20508303517904,39.921451173349304
1461065452153,116.20490906801143,39.89497750809779
1461065464713,116.20491616900186,39.894937884101076
1461065559777,116.2007888326625,39.87976424015985
1461065538944,116.20043438949209,39.88840939307375
1461065479781,116.20492320161654,39.89490457133593
1461065552291,116.20076293884345,39.87977255312887
1461065394684,116.20482293410888,39.902221251706
1461065844796,116.20568571608386,39.84164568171608
1461065864800,116.20547900748646,39.84127567319743
1461065874804,116.20545333620959,39.84125721062067
1461065864803,116.20547900748646,39.84127567319743
1461065849033,116.20568571608386,39.84164568171608
1461065894806,116.20524532701289,39.83999793035757
1461065879044,116.20545333620959,39.84125721062067
1461065914815,116.20566148342324,39.835759249874606
1461065919043,116.20566148342324,39.835759249874606
1461065552291,116.20076293884345,39.87977255312887
1461065899036,116.20524532701289,39.83999793035757
1461065960258,116.20575353945722,39.83509401768901
1461066004839,116.20489834526484,39.81569335543679
1461065688981,116.21435338268914,39.854465224794
1461066009064,116.20489834526484,39.81569335543679
1461066044842,116.20040533940227,39.812345961071095
1461066049084,116.20040533940227,39.812345961071095
1461065552291,116.20076293884345,39.87977255312887
1461065552291,116.20076293884345,39.87977255312887
1461066144870,116.20208998882048,39.81095839373659
1461066149872,116.20208998882048,39.81095839373659
1461066152254,116.20208998882048,39.81095839373659
1461066194882,116.20266017607779,39.807512922188074
1461066199114,116.20266017607779,39.807512922188074
1461065552291,116.20076293884345,39.87977255312887
1461066214888,116.2029514388036,39.80630547120386
1461066219114,116.2029514388036,39.80630547120386
1461066224892,116.20302186678742,39.80504256082543
1461066229138,116.20302186678742,39.80504256082543
1461066234893,116.20302089729492,39.805030212166876
1461066239135,116.20302089729492,39.805030212166876
1461066244896,116.20301649121008,39.80487670968237
1461066249122,116.20301649121008,39.80487670968237
1461066254951,116.20301853363932,39.80487789953302
1461066255000,116.20302057581094,39.80487908927381
1461066264957,116.2030238176259,39.80488097791018
1461066269905,116.20302700622803,39.80488283554547
1461066269934,116.20302700622803,39.80488283554547
1461066304910,116.20595991018364,39.792484884296236
1461066304914,116.20595991018364,39.792484884296236
1461066309918,116.20595991018364,39.792484884296236
1461066239135,116.20302089729492,39.805030212166876
1461066234893,116.20302089729492,39.805030212166876
1461066269905,116.20302700622803,39.80488283554547
1461066269934,116.20302700622803,39.80488283554547
1461066349151,116.20679283691138,39.79083263320359
1461066264957,116.2030238176259,39.80488097791018
1461066244896,116.20301649121008,39.80487670968237
1461066304914,116.20595991018364,39.792484884296236
1461066229138,116.20302186678742,39.80504256082543
1461066359957,116.20675322683068,39.79079586651244
1461066359926,116.20675322683068,39.79079586651244
1461066254951,116.20301853363932,39.80487789953302
1461066249122,116.20301649121008,39.80487670968237
1461066394937,116.2107294669892,39.786188388352684
1461066399346,116.2107294669892,39.786188388352684
1461066409938,116.21091732724342,39.78607921700754
1461066409956,116.21091732724342,39.78607921700754
1461066499962,116.21399224233933,39.77708762923146
1461066509967,116.2142472405229,39.77629900666859
1461066404986,116.2109003301105,39.786044807080295
1461066514964,116.21418369998136,39.77624764550765
1461066529968,116.21432245725572,39.776351370063594
1461066309918,116.20595991018364,39.792484884296236
1461066519965,116.21417462924076,39.77624910943905
1461066544972,116.21497792054844,39.77611033876201
1461066559202,116.2159140339355,39.77638029893072
1461066304910,116.20595991018364,39.792484884296236
1461066579215,116.21545468367816,39.77679681420765
1461066504959,116.2142472405229,39.77629900666859
1461066594991,116.21700191539189,39.77642603134226
1461066539211,116.21461521320931,39.77614635831446
1461066554969,116.2159140339355,39.77638029893072
1461066255000,116.20302057581094,39.80487908927381
1461066569212,116.2167287887716,39.77635868273428
1461066564976,116.2167287887716,39.77635868273428
1461066549974,116.21514402920957,39.77612323027668
1461066604984,116.21646982007232,39.77651298213666
1461066609221,116.21646982007232,39.77651298213666
1461066614985,116.21646467918646,39.776513916228986
1461066619991,116.21646467918646,39.776513916228986
1461066624987,116.21646600445298,39.776513824837366
1461066629222,116.21646600445298,39.776513824837366
1461066635212,116.21645846002403,39.776494896892224
1461066635044,116.21646145865014,39.7765044634732
1461066344922,116.20679283691138,39.79083263320359
1461066584983,116.21649166231514,39.77656008564549
1461066534968,116.21461521320931,39.77614635831446
1461066525015,116.21432245725572,39.776351370063594
1461066599219,116.21700191539189,39.77642603134226
1461066589217,116.21649166231514,39.77656008564549
1461066650057,116.21644054095984,39.776437729319134
1461066654998,116.21642283164014,39.776381230898316
1461066659997,116.21637945959665,39.77641905934377
1461066665000,116.21636492620523,39.77647477409208
1461066670012,116.21636044068617,39.77647859451652
1461066674268,116.21636044068617,39.77647859451652
1461066680006,116.21635894117746,39.776488211017835
1461066684282,116.21635894117746,39.776488211017835
1461066690008,116.21636002160211,39.77649373551854
1461066694265,116.21636002160211,39.77649373551854
1461066700008,116.2163890718791,39.77640635553075
1461066705013,116.21616408785934,39.77628262000664
1461066710017,116.21628243336207,39.77636382734806
1461066714278,116.21628243336207,39.77636382734806
1461066720088,116.21621841974486,39.776364005587155
1461066720088,116.21621841974486,39.776364005587155
1461066725024,116.21619891982871,39.77631301474546
1461066735024,116.21615061014211,39.77631489004157
1461066740026,116.21629944084279,39.776293818402316
1461066744311,116.21629944084279,39.776293818402316
1461066750029,116.21636810313045,39.77631231142938
1461066755030,116.2161842146951,39.77631590728284
1461066760033,116.21619335125258,39.77631915320976
1461066765035,116.21616474664948,39.77629510823768
1461066770038,116.21608003954498,39.77635388122223
1461066255000,116.20302057581094,39.80487908927381
1461064929581,116.21678873660487,39.99158273260793
`;
    var lineData = [];
    var pointData = [];
    rs = rs.split("\n");
    var coordinates = [];
    for (var i = 0; i < rs.length - 1; i++) {
      var item = rs[i].split(",");
      coordinates.push([item[1], item[2], item[0]]);
      pointData.push({
        geometry: {
          type: 'Point',
          coordinates: [item[1], item[2]]
        }
      });
    }
    coordinates.sort(function (a, b) {
      return a[2] - b[2];
    });
    lineData.push({
      geometry: {
        type: 'LineString',
        coordinates: coordinates
      }
    });

    var mapvLayer = new mapv.googleMapLayer(map, new mapv.DataSet(lineData), {
      strokeStyle: 'rgba(55, 50, 250, 1)',
      lineWidth: 3,
      draw: 'simple'
    });

    var mapvLayer = new mapv.googleMapLayer(map, new mapv.DataSet(pointData), {
      fillStyle: 'rgba(255, 250, 50, 1)',
      size: 3,
      draw: 'simple'
    });

  // });


</script>

</body>
</html>
